Mmap throws an error: mmap object has no attribute 'split'